<template>
	<view class="person_bank_revise">
		<view class="main">
			
			
			<view class="input">
				<view class="left">登录账号</view>
				<view class="right">
					<u-input v-model="user_info.username" type="text" :clearable='false' placeholder='请输入账号' />
				</view>
			</view>
			<view class="input">
				<view class="left">登录密码</view>
				<view class="right input_pass">
					<image v-if="passShow" @click="passBtn" src="@/static/images/pass_icon2.jpg" mode=""></image>
					<image v-else @click="passBtn" src="@/static/images/pass_icon1.jpg" mode=""></image>
					<u-input v-model="pass" :type="passShow?'text':'password'" :clearable='false' :password-icon='false' placeholder='请输入密码' />
				</view>
			</view>
			<view class="input">
				<view class="left">代理姓名</view>
				<view class="right">
					<u-input v-model="user_info.nickname" type="text" :clearable='false' placeholder='请输入代理姓名' />
				</view>
			</view>
			<view class="input">
				<view class="left">手机号</view>
				<view class="right">
					<u-input v-model="user_info.mobile" type="text" :clearable='false' placeholder='请输入手机号' />
				</view>
			</view>
			<view class="input">
				<view class="left">微信号</view>
				<view class="right">
					<u-input v-model="user_info.wx" type="text" :clearable='false' placeholder='请输入微信号' />
				</view>
			</view>
			<view class="input">
				<view class="left">身份证号</view>
				<view class="right">
					<u-input v-model="user_info.identitycard" type="text" :clearable='false' placeholder='请输入' />
				</view>
			</view>
		</view>
		<!-- 底部 -->
		<BottomBtn title='保存' @submit='submitBtn'></BottomBtn>
		
<!-- 		<view class="footer_btn">
			<view class="btn" @submit='submitBtn'>添加</view>
		</view> -->
	</view>
</template>

<script>
	import { mapState } from 'vuex';
	import BottomBtn from '@/components/bottom_btn/bottom_btn.vue';
	export default {
		components:{
			BottomBtn
		},
		data() {
			return {
				show:false,
				list:[],
				bankId:'',
				bank:'',
				card:'',
				// 
				pass:'',
				passShow:false,
				code:'',
				disabled:false,
				sendTime:60,
				time:null,
				user_info:[],
			};
		},
		onLoad(opt) {
			
		},
		methods:{
			
			// 查看密码
			passBtn(){
				this.passShow=!this.passShow
			},
			
			// 底部按钮
			submitBtn(){
				var that = this
					that.$tips.showLoading('保存中')
					var params = {
						username:that.user_info.username,
						nickname:that.user_info.nickname,
						password:that.pass,
						mobile:that.user_info.mobile,
						wx:that.user_info.wx,
						wx:that.user_info.wx,
						ids:that.user_info.id,
						identitycard:that.user_info.identitycard
					}
					that.$httpApi.addagency(params).then((res)=>{
						that.$tips.hideLoading()
						if(res.code==1){
							that.$tips.showToast('保存成功')
							that.$store.dispatch('GetUserInfo')
							setTimeout(function(){
								uni.navigateBack()
							},2000)
						}
					})
			},
		}
	}
</script>

<style lang="less">
	
	.footer_btn{

		width: 100%;
		background: #fff;
		padding-top: 20rpx;
		padding-left: 32rpx;
		padding-right: 32rpx;
		.btn{
			width: 100%;
			height: 88rpx;
			line-height: 88rpx;
			text-align: center;
			color: #fff;
			font-size: 32rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			background: #26C281;
			border-radius: 44rpx;
		}
	}
	.person_bank_revise{
		width: 100%;
		padding-top: 24rpx;
		.main{
			width: 100%;
			padding: 20rpx 32rpx;
			background: #fff;
			.input{
				width: 100%;
				height: 100rpx;
				display: flex;
				align-items: center;
				.left{
					width: 200rpx;
					font-size: 28rpx;
					font-family: PingFang SC-Medium, PingFang SC;
					font-weight: 500;
					color: #222222;
				}
				.right{
					width: calc(100% - 200rpx);
					display: flex;
					align-items: center;
					u-input{
						width: 100%;
						font-size: 28rpx;
						font-family: PingFang SC-Medium, PingFang SC;
						font-weight: 500;
						color: #222222;
					}
					.right_text{
						width: 100%;
						display: flex;
						align-items: center;
						justify-content: space-between;
						.r_txt{
							font-size: 28rpx;
							font-weight: 500;
							color: rgb(192, 196, 204);
						}
						.r_txt_color{
							color: #222222;
						}
					}
				}
				.right_code{
					width: calc(100% - 200rpx);
					display: flex;
					align-items: center;
					justify-content: space-between;
					u-input{
						width: calc(100% - 160rpx);
						font-size: 28rpx;
						font-family: PingFang SC-Medium, PingFang SC;
						font-weight: 500;
						color: #222222;
					}
					text{
						display: block;
						width: 160rpx;
						line-height: 70rpx;
						text-align: center;
						font-size: 28rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #26C281;
					}
				}
			}
		}
		.input_pass{
			width: 100%;
			height: 80rpx;
			margin-top: 40rpx;
			border-bottom: 1rpx solid rgba(190, 190, 190, 0.2);
			display: flex;
			align-items: center;
			justify-content: space-between;
			image{
				display: block;
				width: 40rpx;
				height: 40rpx;
			}
			.pass{
				width: calc(100% - 200rpx);
				::v-deep .u-input__input{
					font-size: 32rpx;
					font-family: PingFang SC-Medium, PingFang SC;
					font-weight: 500;
					color: #222222;
				}
			}
			.btn{
				font-size: 28rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
			}
		}
	}
</style>
